﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.IO;

public partial class Reportes : System.Web.UI.Page
{

    /**
     *@author  
     **/
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void generarPDF(object sender, EventArgs e)
    {
        Document document = new Document();
        PdfWriter.GetInstance(document, new FileStream("F:prueba.pdf", FileMode.OpenOrCreate));
        document.Open();
        document.Add(new Paragraph("Este es mi primer PDF"));
        document.Close();
    }

    private readonly string[] NAMES = new string[] { 
    "Mark", "Tom", "Harry", "Sally", "Sandra", "Paul", "Anastasia" };


    private void FillListBoxRandom()
    {
        lblNames.Text = "";
        
        List<String> names = new List<string>();

        int count = NAMES.Length;

        for (int i = 1; i < 30; i++)
        {
            System.Threading.Thread.Sleep(100);
            Random rnd = new Random();
            int number = rnd.Next(count);
            string selName = NAMES[number];
            if (!names.Contains(selName))
            {
                names.Add(selName);
            }
        }

        foreach (string name in names)
            lblNames.Text += name + "<BR />";

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        FillListBoxRandom();
    }

    protected void buttonRegresar(object sender, EventArgs e)
    {
        string direccion = "../Home.aspx";
        Response.Redirect(direccion);
    }

    protected void buttonAyuda(object sender, EventArgs e)
    {

    }

}
